﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace RJ.Objects.GameEngine
{
    public class SpriteManager
    {
        private SpriteSheet spriteSheet;

        private List<Sprite> sprites;
        public List<Sprite> Sprites { get { return sprites; } }

        private int spriteCount = 0;

        public SpriteManager(SpriteSheet spriteSheet)
        {
            this.spriteSheet = spriteSheet;
            sprites = new List<Sprite>();
        }

        public void Add(Sprite sprite)
        {
            sprites.Add(sprite);
            spriteCount++;
        }

        public void DrawSprites(Graphics graphicsFromBuffer)
        {
            for (int i = 0; i < spriteCount; i++)
                spriteSheet.DrawSprite(graphicsFromBuffer, sprites[i]);
        }
    }
}
